home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-09 | 1012 b | 41 lines | [TEXT/MEDT] |
- MODULE TextExample; (* demonatrates the use of text windows*)
-
- FROM TextWindows IMPORT Window,OpenTextWindow, CloseTextWindow, WriteLn,
- WriteString, WriteInt, Write, IdentifyPos;
- FROM CursorMouse IMPORT GetMouse, ML, MM;
-
- VAR Buttons : BITSET;
- x,y,col,
- line : INTEGER;
- w : Window;
-
- BEGIN
- OpenTextWindow(w,5,5,502,315,"TextWindow-Demo");
- WriteString(w,"Press the mouse button!");
- WriteLn(w);
- WriteLn(w);
- LOOP
- GetMouse(Buttons,x,y);
- IF (MM IN Buttons) & (ML IN Buttons) THEN
- EXIT
- ELSIF (ML IN Buttons) THEN
- IdentifyPos(w,x,y,line,col);
- WriteString(w,"You pressed the mouse button at position (");
- WriteInt(w,x,3);
- Write(w,",");
- WriteInt(w,y,3);
- WriteString(w,") on the screen,");
- WriteLn(w);
- WriteString(w,"i.e. in line ");
- WriteInt(w,line,2);
- WriteString(w," and column ");
- WriteInt(w,col,2);
- Write(w,".");
- WriteLn(w);
- WriteLn(w);
- END (* IF *)
- END (* LOOP *);
- CloseTextWindow(w);
- END TextExample.
-
-